#ifndef CAMERA_H
#define CAMERA_H

#include "d3dUtil.h"
#include "TypeUtil.h"
#include "Node.h"
#include "GlobalMessage.h"
#include "MessageQueryer.h"

#include "KeyboardListener.h"
#include "KeyboardSubject.h"
#include "MouseSubject.h"
#include "MouseListener.h"

class Camera: public Node ,public KeyboardListener  ,public MouseListener
{
public:
	Camera(std::string name="camera");
	virtual ~Camera(void);

	void init();

	//update the view matrix
	void UpdateViewMatrix();

	//get the camera view matrix
	D3DXMATRIX GetView();

	//listen the keyboard message
	virtual void KeyboardUpdate(KeyboadMsg msg);
	//listen the mouse message
	virtual void MouseUpdate(MouseMsg msg,const Point& oldPoint,const Point& currPoint);

private:
	void MouseMove(const Point& oldPoint,const Point& currPoint);

	void walk(Direction direction);

private:
	D3DXMATRIX				m_matView;
	float					m_iSpeed;
};



#endif
